@extends('layout.index')

@section('title', '分类修改')
@section('content')
    <div class="mws-panel grid_8">
        <div class="mws-panel-header">
            <span>分类修改</span>
        </div>
        <div class="mws-panel-body no-padding">
            <form action="/admin/cate/update" method="post" class="mws-form">

            @if(count($errors)>0)
                <div class="mws-form-message error">
                    <ul>
                        @foreach ($errors->all()  as $error)
                        
                                <li>{{$error}}</li>
                        @endforeach
                    </ul>
                </div>
    
            @endif
                <div class="mws-form-inline">
                    <div class="mws-form-row">
                        <label class="mws-form-label">分类名</label>
                        <div class="mws-form-item">
                            <input type="text" value="{{$catesinfo->catename}}" name="catename" class="small">
                        </div>
                    </div>
                    <div class="mws-form-row">
                        <label class="mws-form-label">分类列表</label>
                        <div class="mws-form-item">
                            <select name="pid" class="small">
                                <option value='0'>顶级分类</option>
                                @foreach ($cates as $k=>$v)
                                <option value='{{$v->id}}' @if($v->id == $catesinfo->pid)
                                                        selected
                                                        @endif 
                                >{{$v->catename}}</option>s
                                @endforeach
                            </select>
                        </div>
                    </div>
                <input type="hidden" name="id" value="{{$catesinfo->id}}">
                    
                {{csrf_field()}}  
                </div>
                <div class="mws-button-row">
                    <input type="submit" class="btn btn-primary" value="提交">
                    <input type="reset" class="btn " value="重置">
                </div>
            </form>
        </div>      
    </div>

@endsection